package com.webssh.service.handler;

import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

import com.webssh.service.handler.process.ProcessHandshakeInterceptor;

//@Component
//@EnableWebSocket
public class WSConfig implements WebSocketConfigurer{

	private String sh = "ws/runtime";
	
	private String memory = "ws/memory";
	
	@Override
	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		ProcessHandshakeInterceptor interceptor =  new ProcessHandshakeInterceptor();
		WSHandler handler = new WSHandler();
		registry.addHandler(handler, memory).addInterceptors(interceptor);
		registry.addHandler(handler, sh).addInterceptors(interceptor);
	}
	
}